$(function () {
    /*供货商所有单据*/
    $('#firstDate').datetimepicker({
        //viewMode: 'day',
        format: 'YYYY-MM-DD'
    });
    $('#secondDate').datetimepicker({
        format: 'YYYY-MM-DD',
        useCurrent: false //Important! See issue #1075
    });
    $("#firstDate").on("dp.change", function (e) {
        $('#secondDate').data("DateTimePicker").minDate(e.date);
    });
    $("#secondDate").on("dp.change", function (e) {
        $('#firstDate').data("DateTimePicker").maxDate(e.date);
    });
    $('#pop').bootstrapTable({
        url: '${pageContext.request.contextPath}/../../Qbb/Qhguszelnk',
        columns: [
            {
                field:'date',
                title:'时间'
            },{
                field: 'names',
                title: '货品名称'
            },{
                field:'companyid',
                title:'进货数量',
                visible : false,
            },{
                field:'typeid',
                title:'类型',
                formatter: function (value, row, index) {
                    if(row.typeid == 1){
                        return "进货";
                    }else if(row.typeid == 2){
                        return "出货";
                    }else if(row.typeid == 3){
                        return "退货（客户）";
                    }else if(row.typeid == 4){
                        return "退货（供货商）";
                    }

                }
            },{
                field:'XX',
                title:'变动',
                formatter: function (value, row, index) {

                    if(row.typeid == 1 || row.typeid ==3){
                        return "+"+row.companyid;
                    }else if(row.typeid == 2 || row.typeid ==4){
                        return "-"+row.companyid;
                    }
                }
            }],
    });

}) ;







